package com.woniuxy.micropurchaseserver.purchasereturnmsg.controller;

import com.woniuxy.micropurchaseserver.bean.PurchaseReturnBean;
import com.woniuxy.micropurchaseserver.purchasereturnmsg.service.PurchaseReturnService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/purchaseReturn")
public class PurchaseReturnController {
    @Resource
    private PurchaseReturnService purchaseReturnService;
    @RequestMapping(value = "/inc",produces = {"application/json;charset=utf-8"})
    public Long IncPurchaseReturn(PurchaseReturnBean purchaseReturnBean){
        Long i =purchaseReturnService.InsertPurchaseReturn(purchaseReturnBean);
        return i;
    }
    @RequestMapping(value = "/find",produces = {"application/json;charset=utf-8"})
    public List<PurchaseReturnBean> FindPurchaseReturn(PurchaseReturnBean purchaseReturnBean){
        List<PurchaseReturnBean> purchaseReturnBeans =purchaseReturnService.findAllPurchaseReturn(purchaseReturnBean);
        return purchaseReturnBeans;
    }
    @RequestMapping(value = "/update",produces = {"application/json;charset=utf-8"})
    public Integer UpdatePurchaseReturn(PurchaseReturnBean purchaseReturnBean){
        Integer i =purchaseReturnService.UpdatePurchaseReturn(purchaseReturnBean);
        return i;
    }
    @RequestMapping(value = "/del",produces = {"application/json;charset=utf-8"})
    public Integer DelPurchaseReturn(Integer id){
        Integer i =purchaseReturnService.deletePurchaseReturnById(id);
        return i;
    }
}
